//
//  MediaShareBB.h
//  MediaShareBB
//
//  Created by Artak Gevorgyan on 5/23/13.
//  Copyright (c) 2013 InnoriseEntertainment. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "MediaShareBBConstants.h"

// Some forward declarations
@class MediaShareCommunity;
@class MediaShareData;

/**
 * Delegate of the MediaShareBB, informs about various events
 */
@protocol MediaShareBBDelegate <NSObject>

-(void) canceled;
-(void) mediaShareCommunitySelected:(MediaShareCommunity*) comm;
-(void) willShareMedia:(MediaShareData*) media through:(MediaShareCommunity*) comm;
-(void) updateProgress:(CGFloat) progress forCommunity:(MediaShareCommunity*) comm;
-(void) didFinishSharingMedia:(MediaShareData*) media through:(MediaShareCommunity*) comm;
-(void) didFailedSharingMedia:(MediaShareData*) media through:(MediaShareCommunity*) comm
					withError:(NSError*) error;

@end

@interface MediaShareBB : UIViewController

/// This delegation must be used to be notified on the media share related events
@property (nonatomic, assign) id<MediaShareBBDelegate> delegate;

/// Default constructor
-(id) init;

/// Initialize the MediaShareBB with all communities support
-(id) initWithAllCommunitiesSupport;

/// Add new supported community to use in sharing
-(void) addSharingNetwork:(enum MediaShareCommunities) sh
		  withCredentials:(NSDictionary*) credentials;

/// Get the list of all the configured communities
-(NSArray*) configuredCommunities;

/// Notify the MediaShareBB that the communtiy has beel selected from a custom UI
-(void) communitySelected:(MediaShareCommunity*) comm;

/// Sets community with given type as a selected
-(void) setSelectedCommunityWithType:(enum MediaShareCommunities) commType;

// get community
-(MediaShareCommunity*) getCommunityByType:(enum MediaShareCommunities) cmmType;

//get selected Comunity
-(MediaShareCommunity*) getSelectedCommunity ;

-(void) sendViaEmail:(MediaShareData*) data;

@end
